<template>
  <div>
    <el-form label-width="100px" label-position="left">
      <el-button
        class="btn"
        type="primary"
        plain
        @click="editApi"
        >编辑API接口</el-button>
      <!-- <el-button
        class="btn1"
        type="primary"
        plain
        @click="saveDataBtn"
        >刷新</el-button> -->
    </el-form>
    <!-- 编辑api弹窗 -->
    <CodeDialog
      :dialogVisibleCode="dialogVisibleCode"
      ref="CodeDialog"
    />
  </div>
</template>
<script>
import CodeDialog from "./codeDialog";
export default {
  name: "DynamicComponents",
  provide() {
    return {
      dynamicComponent: this,
    };
  },
  components: {
    CodeDialog
  },
  props: {
    chartType: String,
  },
  data() {
    return {
      dialogVisibleCode: false // 代码框是否显示
    };
  },
  watch: {
    // formData: {
    //   handler(val) {
    //     this.echoDataSet(val);
    //   },
    //   deep: true
    // }
  },

  mounted() {
  },
  methods: {
    // 编辑接口文档
    editApi() {
      this.dialogVisibleCode = true
      // 默认赋值
      this.$refs.CodeDialog.initformVal()
    },
  }
};
</script>
<style scoped lang="less">
.btn {
  width: 100%;
  margin: 10px 0 0 0;
  background-color: transparent;
  color: #2681ff;
  border-color: #2681ff;
}
.btn1 {
  width: 100%;
  margin: 10px 0 0 0;
}
</style>
